home *** CD-ROM | disk | FTP | other *** search
- property pIndicatorLowerLimit, pIndicatorRange, pClickedStatus, pCurrentSprite
-
- on beginSprite me
- set pCurrentSprite to the spriteNum of me
- set spacing to 3
- set offset to (the height of sprite pCurrentSprite / 2) + spacing
- set trackSprite to pCurrentSprite - 1
- set trackSpriteTop to the top of sprite trackSprite
- set pIndicatorLowerLimit to trackSpriteTop + offset
- set trackSpriteBottom to the bottom of sprite trackSprite
- set indicatorUpperLimit to trackSpriteBottom - offset
- set pIndicatorRange to indicatorUpperLimit - pIndicatorLowerLimit
- set the locV of sprite pCurrentSprite to pIndicatorLowerLimit
- end
-
- on positionIndicator me, textRatio
- set currentPosition to pIndicatorRange * textRatio
- set indicatorPosition to currentPosition + pIndicatorLowerLimit
- set the locV of sprite pCurrentSprite to indicatorPosition
- end
-
- on mouseDown me
- end
-
- on exitFrame me
- if the mouseDown and (the clickOn = pCurrentSprite) then
- scrollTextWithIndicator(me, the mouseV)
- end if
- end
-
- on scrollTextWithIndicator me, mouseVertical
- set nextPosition to mouseVertical
- if nextPosition < pIndicatorLowerLimit then
- set nextPosition to pIndicatorLowerLimit
- else
- set upperLimit to pIndicatorLowerLimit + pIndicatorRange
- if nextPosition > upperLimit then
- set nextPosition to upperLimit
- end if
- end if
- set ratioPosition to float(nextPosition - pIndicatorLowerLimit)
- set ratio to ratioPosition / pIndicatorRange
- sendAllSprites(#scrollText, ratio)
- end
-
- on getIndicatorPosition me
- return the locV of sprite pCurrentSprite
- end
-